for /f "tokens=* usebackq" %%i IN (`"@for %%i in (.) do echo %%~nxi"`) do (
set ROOT=%%i
)
for %%i in ("%~dp0.") do SET "PWD=%%~fi"
@rem echo %PWD%

IF "%~1" NEQ "" (
call:%~1 %~2 %~3
) else (
echo Usage:^ %~0^ xxx
)
GOTO:EOF

:merge
   echo "Merging">>nohup.out
   echo "%time%" >>nohup.out

   for /f "tokens=2 delims==" %%i in ('wmic OS Get localdatetime /value') do set "dt=%%i"
   copy /b assets\xml\*.xml %dt:~0,14%.xml

   echo "Merged">>nohup.out
   echo %time%>>nohup.out
GOTO:EOF

:doc
   pandoc -o 1.html 1.md
   scp "1.html" "root@172.16.0.59:/var/www/"
   scp assets\* "root@172.16.0.59:/var/www/assets/"
   explorer "http://172.16.0.59:19120/1.html"
GOTO:EOF

:reboot
   call mvn -Dmaven.test.skip=true clean package
   for %%i in (target\*.jar) do (
      java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address="65534" -jar %%i
      GOTO:EOF
   )
GOTO:EOF

:imp
   mysql -v --user=root --password="s3cret" --host="172.16.0.59" <"files\mockinstances.sql"
GOTO:EOF

:login
   mysql -v --user=root --password="s3cret" --host="172.16.0.59"
GOTO:EOF

:addColumnToModel
   mysql -v --user=devl --password="Power2021!" --host="172.16.0.105" -Dbls_smart<"1.sql"
GOTO:EOF

:findModel
   call :traverse
   goto :eof

   :traverse
   @REM Do whatever you want here over the files of this subdir, for example:
   for %%f in (*.java) do (
      findstr /M /P /G:"%PWD%\table.txt" %%f
      @REM findstr /M /P /G:"%PWD%\table.txt" %CD%\%%f
      @REM findstr /P /G:"%PWD%\table.txt" %%f
   )

   for /D %%d in (*) do (
      cd %%d
      call :traverse
      cd ..
   )
   exit /b
GOTO:EOF

:openModel
   for /F "tokens=*" %%i in (Model.txt) do (
      gvim.exe %%i
   )
GOTO:EOF

:openMapper
   for /F "tokens=*" %%f in (mapper.txt) do (
      for /f "delims=" %%i in ('dir /s /b /a-d "%%f"') do (
         IF %ERRORLEVEL% == 0 (
            gvim.exe %%i
         )
      )
   )
GOTO:EOF
